﻿@using Windvoice.Blog
@{
    ViewBag.Title = "Friends";
    Layout = "~/Areas/Manage/Views/Shared/_Layout.cshtml";
}

@section headSection{
    <script type="text/javascript">
        $(function () {
            $('a[data-delete]').click(function () { $(this).handledelete('/manage/friend/delete') });
        });
    </script>
}

<div class="pagetitle">
    <h2>好友链接管理</h2>
    <div class="pagefunctions">
        @Html.ActionLink("创建好友", "create")
    </div>    
</div>

<ul class="friend-list">
    @foreach (Friend friend in (Friend[])ViewBag.FriendList)
    {
        <li>
            <div class="title">
                <div class="titlevalue">
                    <span>@friend.Name</span><br/>
                    <img src="@friend.Portrait" alt="@friend.Name" />
                </div>
                <div class="operate">
                    <a href="/manage/friend/edit/@friend.ID">编辑</a>
                    <a href="javascript:;" data-delete="@friend.ID">删除</a>
                </div>
            </div>
            <div class="content">
                <span>@friend.LinkUrl</span>
            </div>
        </li> 
    }
</ul>